<?php
namespace app\index\controller;

use think\Db;
use think\Session;
use app\common\controller\IndexBase;

class Upgoods extends IndexBase
{
	public function index(){
		$status = input('param.status');
		$where['user_id'] = $this->userInfo["id"];
		switch ($status) {
			case 'que':
				$where['status'] = 1;
			break;
			case 'fahuo':
				$where['status'] = 2;
			break;
			case 'shouhuo':
				$where['status'] = 3;
			break;
			case 'wanchang':
				$where['status'] = 4;
			break;
			default:
				$status = 'all';
			break;
		}
		$list = Db::name("Up_goods")->where($where)->order('add_time desc')->select();
        $this->titleName = "我的订单";
        $this->assign("status",$status);
        $this->assign("data",$list);
        return $this->fetch();
    }

    public function detail(){
    	$order_id = input('param.id');
    	$order = Db::name('up_goods')->where('id',$order_id)->find();
    	$this->assign("order",$order);
    	return $this->fetch();
    }
}